from django.db import models
from gxdm.models import *


class DataCenterModel(models.Model):

    source = models.CharField("数据来源", max_length=255, blank=True, null=True)
    priority = models.IntegerField("优先级", default=10)
    lock = models.BooleanField("锁定", default=False)
    mode = models.CharField('更新模式', max_length=2, default='01')
    remarks = models.CharField("备注", max_length=255, blank=True, null=True)
    create_time = models.DateTimeField("创建时间", auto_now_add=True)
    update_time = models.DateTimeField("更新时间", auto_now=True)

    class Meta:
        managed = False
        abstract = True


class CodeModel(models.Model):
    def __str__(self):
        return self.label

    class Meta:
        managed = False
        abstract = True